<template>
    <div class="about-container">
      <!-- 标题 -->
      <header class="hero-section">
        <h1>关于我</h1>
        <p class="subtitle">分享技术见解、学习心得以及生活点滴</p>
      </header>
  
      <!-- 博主简介 -->
      <section class="about-section">
        <h2>博主简介</h2>
        <p>大家好，我是山海，一名热爱技术和分享的技术博主。在这里，我会分享我的技术见解、学习心得以及生活点滴。</p>
      </section>
  
      <!-- 博客目的和主题 -->
      <section class="about-section">
        <h2>博客目的和主题</h2>
        <p>本博客旨在记录我的技术成长历程，并希望通过分享能帮助到更多的人。博客主要涉及前端开发、后端架构、数据库管理等方面的内容。</p>
      </section>
  
      <!-- 联系方式 -->
      <section class="contact-section">
        <h2>联系我</h2>
        
        <ul class="contact-list">
          <!-- 使用 v-for 循环生成联系项 -->
          <li v-for="contact in contacts" :key="contact.id" class="contact-item" :class="contact.type">
            <div class="icon">
              <i :class="contact.iconClass"></i>
            </div>
            <div class="contact-info">
              <h3>{{ contact.title }}</h3>
              <p v-if="contact.href"><a :href="contact.href">{{ contact.value }}</a></p>
              <p v-else>{{ contact.value }}</p>
              <img v-if="contact.qrCode" :src="contact.qrCode" alt="二维码" class="qr-code">
            </div>
          </li>
        </ul>
      </section>
  
      <!-- 版权声明 -->
      <section class="about-section">
        <h2>版权声明</h2>
        <p>本站所有内容均受版权保护，未经许可不得转载。如需合作，请通过上述联系方式与我联系。</p>
      </section>
  
      <!-- 社交媒体链接 -->
      <!-- <section class="about-section">
        <h2>社交媒体</h2>
        <ul class="social-media-list">
          <li><a href="https://github.com/yourusername" target="_blank">GitHub</a></li>
          <li><a href="https://linkedin.com/in/yourusername" target="_blank">LinkedIn</a></li>
          <li><a href="https://twitter.com/yourusername" target="_blank">Twitter</a></li>
        </ul>
      </section> -->
    </div>
  </template>
  
  <script setup>
  import { ref } from 'vue';
  
  const contacts = ref([
    {
      id: 1,
      type: 'phone',
      iconClass: 'fas fa-phone-alt fa-lg',
      title: '电话联系',
      href: 'tel:+8615937994309',
      value: '+86 159 3799 4309'
    },
    {
      id: 2,
      type: 'wechat',
      iconClass: 'fab fa-weixin fa-lg',
      title: '微信联系',
      value: '微信号：YourWeChatID',
      qrCode: 'https://static.leiqichao.cn/wechat-qr.png' // 确保路径正确
    },
    {
      id: 3,
      type: 'email',
      iconClass: 'fas fa-envelope fa-lg',
      title: '邮件联系',
      href: 'mailto:15937994309@163.com',
      value: '15937994309@163.com'
    }
  ]);
  </script>
  
  <style scoped>
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  }
  
  body {
    background-color: #f5f5f5;
    line-height: 1.6;
  }
  
  .about-container {
    max-width: 900px;
    margin: 50px auto;
    padding: 30px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
  }
  
  .hero-section {
    text-align: center;
    margin-bottom: 40px;
  }
  
  .hero-section h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
  }
  
  .subtitle {
    color: #666;
    font-size: 1.2em;
    margin-bottom: 20px;
  }
  
  .about-section {
    margin-bottom: 40px;
  }
  
  .about-section h2 {
    color: #333;
    font-size: 1.8em;
    margin-bottom: 20px;
    position: relative;
  }
  
  .about-section h2::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: #4CAF50;
  }
  
  .about-section p {
    color: #666;
    line-height: 1.8;
  }
  
  .contact-section {
    margin-bottom: 40px;
  }
  
  .contact-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
  }
  
  .contact-item {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    transition: transform 0.3s ease;
    flex-basis: calc(33.333% - 20px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }
  
  .contact-item:hover {
    transform: translateY(-10px);
  }
  
  .icon {
    width: 50px;
    height: 50px;
    margin-right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white;
  }
  
  .phone .icon { background-color: #4CAF50; }
  .wechat .icon { background-color: #09b83e; }
  .email .icon { background-color: #e74c3c; }
  
  .contact-info h3 {
    color: #333;
    margin-bottom: 5px;
  }
  
  .contact-info p {
    color: #666;
  }
  
  .qr-code {
    margin-top: 15px;
    width: 150px;
    border: 1px solid #ddd;
    padding: 5px;
    border-radius: 5px;
  }
  
  .social-media-list {
    list-style: none;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 20px;
  }
  
  .social-media-list a {
    color: #333;
    text-decoration: none;
    font-size: 1.1em;
    transition: color 0.3s ease;
  }
  
  .social-media-list a:hover {
    color: #4CAF50;
  }
  
  @media (max-width: 768px) {
    .about-container {
      margin: 20px;
      padding: 20px;
    }
  
    .contact-list {
      flex-direction: column;
      align-items: center;
    }
  
    .contact-item {
      flex-basis: 100%;
    }
  
    .social-media-list {
      flex-wrap: wrap;
    }
  }
  </style>